<#include '/admin/header.html' >
<div  class="admin-main">
   <div>
        <!--提示区域  -->
        <div class="page_explain">
            <h2>操作提示</h2>
            <ul>
                <li><span>·</span>该列表无法做出删除和修改操作，但是可以恢复列表中的会员到正常的会员列表中。</li>
            </ul>
        </div>
        <!--按钮操作  -->
        <div class="table_control">
            <div class="table_opera">
                <button type="button" class="layui-btn layui-btn-primary " title="恢复" onclick="recovery();"><i class="layui-icon">&#xe603;</i></button>
                <button type="button" class="layui-btn layui-btn-primary " title="说明" id="explain"><i class="icon iconfont icon-tishi1"></i></button>
            </div>
        </div>
    </div>
    
    <!--表格区域  -->
   <form id="regainform">
    <table id="regaindata" class="layui-table site-table table-hover" width="100%" lay-skin="line">
        <thead>
          <tr>
            <th><input type='checkbox'  class='btn-checkall fly-checkbox' id='selected-all'></th>
            <th>用户名</th>
            <th>手机</th>
            <th>会员等级</th>
            <th>电子邮件</th>
            <th>注册时间</th>
            <th>上次登录日期</th>
            <th>本月登录次数</th>
            <th>城市</th>
            <th>性别</th>
          </tr>
        </thead>
    </table>
    <!--传值等操作(暂定)  -->
    <div id="addBrand" ></div>
   </form>
</div>

<!--js区域  -->
<script>
var table;
$(function(){
	
	table = $('#regaindata').DataTable({
		"language": {
	        "url": "${staticserver}/media/zh_CN.txt"
	    },
	    "processing": true,
	    "serverSide": true,
	    "ordering": false,
	    "searching": false,
	    "lengthChange": false,
	    ajax: {
	        //指定数据源
	        type:"post",
	        url: '${ctx}/shop/admin/member/list-recycle-json.do',
	    },
	    columns: [ //定义列
            {"data": function (obj) {
                return '<input type="checkbox" name="member_id" class="fly-checkbox" value=' + obj.member_id + '>';
            		}},
	        {data: "uname"},
	        {data: "mobile"},
	        {data: "lv_name"},
	        {data: "email"},
	        {data: "regtime"},
	        {data: "lastlogin"},
	        {data: "logincount"},
	        {data: "province"},
	        {data: "sex"}
	     ]
	});
});

//恢复
function recovery(){
	var check = $("input[name='member_id']").is("input:checked");
	if(check == false){
		alert("请选择想要恢复的会员");
		return false;
	}
	var options = {
		url:ctx+"/shop/admin/member/recycle-regain-member.do",
		type:"post",
		dataType:"json",
		success:function(data){
			if(data.result==1){
				$.Loading.success(data.message);
				table.ajax.url(ctx+"/shop/admin/member/list-recycle-json.do").load();
			}
		}
	};
	$("#regainform").ajaxSubmit(options);
}
</script>
<#include '/admin/footer.html' >
